package com.pzhuweb.sgblog.controller;

import com.pzhuweb.sgblog.service.UploadService;
import com.pzhuweb.sgblog.domain.utils.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @author 鄧浩奇
 * @classname uploadController
 * @description 上传头像
 * @since 2023/7/10 16:49
 **/

@RestController
public class UploadController {

    @Resource
    private UploadService uploadService;

    @PostMapping("/upload")
    public ResponseResult<?> uploadImg(MultipartFile img) {
        return uploadService.uploadImg(img);
    }
}
